package com.ruoyi.pms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Arrays;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pms.mapper.PmsTaskTransLogMapper;
import com.ruoyi.pms.domain.PmsTaskTransLog;
import com.ruoyi.pms.service.IPmsTaskTransLogService;

/**
 * 任务转移记录Service业务层处理
 *
 * @author huikai
 * @date 2025-03-18
 */
@Service
public class PmsTaskTransLogServiceImpl extends ServiceImpl<PmsTaskTransLogMapper, PmsTaskTransLog> implements IPmsTaskTransLogService {
    @Autowired
    private PmsTaskTransLogMapper pmsTaskTransLogMapper;

    /**
     * 查询任务转移记录列表
     *
     * @param pmsTaskTransLog 任务转移记录
     * @return 任务转移记录
     */
    @Override
    public List<PmsTaskTransLog> selectPmsTaskTransLogList(PmsTaskTransLog pmsTaskTransLog) {
        return pmsTaskTransLogMapper.selectPmsTaskTransLogList(pmsTaskTransLog);
    }


    /**
    * 查询任务转移记录记录
    * @param logId
    * @return
    */
    @Override
    public PmsTaskTransLog getInfoByLogId(Long logId) {
        return pmsTaskTransLogMapper.selectById(logId);
    }

    /**
     * 新增任务转移记录记录
     * @param pmsTaskTransLog 任务转移记录
     * @return
     */
    @Override
    public Boolean add(PmsTaskTransLog pmsTaskTransLog) {
        return pmsTaskTransLogMapper.insert(pmsTaskTransLog) > 0;
    }

    /**
     * 修改任务转移记录记录
     * @param pmsTaskTransLog 任务转移记录
     * @return
     */
    @Override
    public Boolean edit(PmsTaskTransLog pmsTaskTransLog) {
        return pmsTaskTransLogMapper.updateById(pmsTaskTransLog) > 0;
    }

    /**
     * 删除任务转移记录记录
     * @param logIds
     * @return
     */
    @Override
    public Boolean removeByLogIds(Long[] logIds) {
        return pmsTaskTransLogMapper.deleteBatchIds(Arrays.asList(logIds)) > 0;
    }
}